<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>CSS3新选择器</title>
	<style type="text/css">
		li{
			background-color: gold;
			margin-bottom: 10px;
		}
		/*li:nth-child(1){
			background-color: green;
		}
		li:nth-child(3){
			background-color: pink;
		}*/
		li:nth-of-type(2n-1){
			background-color: green;
		}
		.box div{
			background-color: gold;
			margin-bottom: 10px;
		}
		.box div:nth-child(3){
			background-color: green;
		}
		.box div:nth-of-type(3){
			background-color: pink;
		}

	</style>
</head>
<body>
	<ul>
		<h3>ul</h3>
		<li>1</li>
		<li>2</li>
		<li>3</li>
		<li>4</li>
		<li>5</li>
		<li>6</li>
		<li>7</li>
		<li>8</li>
	</ul>
	<h3>div</h3>
	<div class="box">
		<div>1</div>
		<div>2</div>
		<p>p标签</p>
		<div>3</div>
		<div>4</div>
		<div>5</div>
		<div>6</div>
	</div>
</body>
</html>